package cn.liutao.order.entity.vo;

import cn.liutao.dish.entity.po.DiningTable;
import cn.liutao.order.entity.po.Order;
import com.mybatisflex.annotation.RelationManyToMany;
import com.mybatisflex.annotation.RelationManyToOne;
import lombok.Data;

import java.util.List;

/**
 * @author liutao
 * @Description 订单vo
 * @date 2023/11/2 9:51
 * @Version 1.0
 */
@Data
public class OrderVo extends Order {

    @RelationManyToMany(
            selfField = "id",
            targetField = "id",
            targetTable = "cart",
            joinTable = "order_cart_relation",
            joinTargetColumn = "cart_id",
            joinSelfColumn = "order_id"
    )
    private List<CartVo> itemList;

    private String orderMsg;

    @RelationManyToOne(
            selfField = "tableId",
            targetTable = "dining_table",
            targetField = "id",
            extraCondition = "status = :tableStatus"
    )
    private DiningTable table;

    private String payNo;
}
